package com.gjszn.kh.context;

import java.util.HashMap;
import java.util.Map;

import com.gjszn.kh.model.Member;

/**    
* @Title: MemberContext.java  
* @Package com.gjszn.kh.context    
* @author jys@nx-yt.com    
* @date 2015年12月31日 上午11:18:19  
* @version V1.0    
* @Description: TODO(用一句话描述该文件做什么)
********************************************/
public class MemberContext {
	
	private static Map<String, Member> memberMap = new HashMap<String, Member>();
	
	public static Map<String, Member> getMemberMap() {
		return memberMap;
	}
	
	public static Member getByKey(String memberNo){
		return memberMap.get(memberNo);
	}

	public static void setMemberMap(Map<String, Member> memberMap) {
		MemberContext.memberMap = memberMap;
	}
	
	public static void addMember(Member member){
		memberMap.put(member.getNumber(), member);
	}
	
	public static void updateMember(Member member){
		memberMap.remove(member.getNumber());
		memberMap.put(member.getNumber(), member);
	}
	
	public static void deleteMember(String number){
		memberMap.remove(number);
	}
	
	
}

